home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
math
/
nrpas13
/
bessy1.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-04-29
|
938b
|
24 lines
FUNCTION bessy1(x: real): real;
VAR
xx,z: real; y,ans,ans1,ans2: double;
BEGIN
IF (x < 8.0) THEN BEGIN
y := sqr(x);
ans1 := x*(-0.4900604943e13+y*(0.1275274390e13
+y*(-0.5153438139e11+y*(0.7349264551e9
+y*(-0.4237922726e7+y*0.8511937935e4)))));
ans2 := 0.2499580570e14+y*(0.4244419664e12
+y*(0.3733650367e10+y*(0.2245904002e8
+y*(0.1020426050e6+y*(0.3549632885e3+y*1.0)))));
ans := (ans1/ans2)+0.636619772*(bessj1(x)*ln(x)-1.0/x);
bessy1 := sngl(ans) END
ELSE BEGIN
z := 8.0/x; y := sqr(z); xx := x-2.356194491;
ans1 := 1.0+y*(0.183105e-2+y*(-0.3516396496e-4
+y*(0.2457520174e-5+y*(-0.240337019e-6))));
ans2 := 0.04687499995+y*(-0.2002690873e-3
+y*(0.8449199096e-5+y*(-0.88228987e-6+y*0.105787412e-6)));
ans := sqrt(0.636619772/x)*(sin(xx)*ans1+z*cos(xx)*ans2);
bessy1 := sngl(ans) END
END;